import React, { Component } from 'react';
import dynamic from 'dva/dynamic';
import { Route } from 'dva/router';

export default function timeBuyRoute(app) {

    const TimeBuy = dynamic({
        app,
        models: () => {
            return [
                import(/* webpackChunkName: "timeBuyModel" */'../models/timeBuy/timeBuyModel'),
            ];
        },
        component: () => import(/* webpackChunkName: "timeBuy" */'../routes/timeBuy/timeBuy'),
    });
    const TimeBuyClass = dynamic({
        app,
        models: () => {
            return [
                import(/* webpackChunkName: "timeBuyModel" */'../models/timeBuy/timeBuyModel'),
            ];
        },
        component: () => import(/* webpackChunkName: "timeBuyClass" */'../routes/timeBuy/timeBuyClass'),
    });
    const TimeBuyRemind = dynamic({
        app,
        models: () => {
            return [
                import(/* webpackChunkName: "timeBuyModel" */'../models/timeBuy/timeBuyModel'),
            ];
        },
        component: () => import(/* webpackChunkName: "timeBuyRemid" */'../routes/timeBuy/timeBuyRemind'),
    });


    return (
        [
            <Route key="/timeBuy" exact path="/timeBuy/:data" component={TimeBuy}/>,
            <Route key="/timeBuyClass" exact path="/timeBuyClass" component={TimeBuyClass}/>,
            <Route key="/timeBuyRemind" exact path="/timeBuyRemind" component={TimeBuyRemind}/>,
        ]
    );
}